﻿using System.Collections.Generic;
using FlowCanvas;
using FlowCanvas.Nodes;
using LogSystem;
using NodeCanvas.Framework;
using ParadoxNotion;
using ParadoxNotion.Design;
using UnityEngine;

namespace Yoozoo.Gameplay.Liberty.Nodes
{
    [Category("Ggame")]
    public class DestroyListBoxTrigger : CallableActionNode<List<string>>
    {
        public BBParameter<List<string>> flowTrigger = new BBParameter<List<string>>();
        public override void Invoke(List<string> strList )
        {
            for (int i = 0; i < strList.Count; i++)
            {
                if (BoxTrigger.BlueprintTriggers.ContainsKey(strList[i]))
                {
                    GameObject.DestroyImmediate(BoxTrigger.BlueprintTriggers[strList[i]]);
                    BoxTrigger.BlueprintTriggers.Remove(strList[i]);
                }
            }           
        }
    }
}
